<script setup lang="ts">
import {computed, ref} from "vue";

//let count = ref<number|string>(0);
//count.value = '11';
let count = ref<number>(0);
let doubleCount = computed(() => {
  return count.value * 2;
});
let countAdd = (n:number) => {
    count.value+=n ;
};

interface List {
  username:string
  age:number
}

let list = ref<List[]>([]);
list.value.push({username:'123',age:123});
</script>

<template>
  <div>03_组合式api与ts.vue，
    {{count}},{{doubleCount}}
    <button @click="countAdd(2)">+2</button>
  </div>
</template>

<style scoped>

</style>